/* 
* @Author: Rowger php_echo@163.com
* @Date:   2017-10-26 15:33:32
* @Last Modified by:   Rowger
* @Last Modified time: 2017-10-26 15:55:29
*/

const LOGIN='LOGIN'
const LOGOUT='LOGOUT'

export function auth(state = {isAuth:false,user:'李云龙'}, action) {
    switch (action.type) {
        case LOGIN:
            return {...state,isAuth:true}
        case LOGOUT:
            return {...state,isAuth:false}
        default:
            return state

    }
}
//action
export function login(){
    return {type:LOGIN}
}
export function logout(){
    return {type:LOGOUT}
}